/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author Valdigleis
 */
public class Derby {

    
    // org.apache.derby.jdbc.ClientDriver
    
    private static final String URL =
            "jdbc:derby:intime;user=sad;password=sad123";
    private static final String DRIVER =
            "org.apache.derby.jdbc.EmbeddedDriver";

    public static Connection getConnection() {
        try {
            Class.forName(DRIVER);
            return DriverManager.getConnection(URL);
        } catch (ClassNotFoundException e) {
            System.out.println(e.getMessage());
        } catch (SQLException e) {
            System.out.println(e.getMessage());
        }
        System.err.println("Não conectando ao Banco de Dados");
        return null;
    }

}
